$package('YiYa.merchant');
YiYa.merchant = function(){
	var _box = null;
	var _this = {
		config:{
			dataGrid:{
				title:'产品仓储列表',
				url:'dataList.do?product.type=1',
				columns:[[
				          {field:'id',checkbox:true},
				          {field:'p.code',title:'产品编号',width:120,sortable:true,
				        	  formatter:function(value,row,index){
				        		  return new Object(row["product"]).code;
						  }},
				          {field:'product_name',title:'产品名称',width:120,
				        	  formatter:function(value,row,index){
				        		  return new Object(row["product"]).name;
						  }},
						  {field:'product_color',title:'颜色',width:80,
				        	  formatter:function(value,row,index){
				        		  return new Object(row["product"]).color;
						  }},
						  {field:'p.standard',title:'规格',width:80,sortable:true,
				        	  formatter:function(value,row,index){
				        		  return new Object(row["product"]).standard;
						  }},
						  {field:'r.name',title:'所在仓库',width:80,
				        	  formatter:function(value,row,index){
				        		  return new Object(row["repository"]).name;
						  }},
						  {field:'quantity',title:'数量',width:120,sortable:true}
				          ]],
				          toolbar:[
				                   {id:'btnadd',text:'添加',btnType:'add'},
				                   {id:'btnedit',text:'编辑',btnType:'edit'},
				                   {id:'btndelete',text:'删除',btnType:'remove'}
				                   ]
			}
		},
		init:function(){
			_box = new YDataGrid(_this.config);
			_box.init();
		}
	}
	return _this;
}();

$(function(){
	YiYa.merchant.init();
});


